package org.zfes.snowier.xyz.live.utils;

import java.util.Map;
import java.util.TreeMap;

import org.zfes.snowier.core.util.ZStrUtil;

public class LiveParamUtil {
	public static String sortUrlParm(Map<String ,String> paramMap) {
	    	
			Map<String, String> treeMap = new TreeMap<>();
			treeMap.putAll(paramMap);
			treeMap.remove("sign");
			StringBuilder stringBuilder = new StringBuilder();
	        for (Map.Entry<String, String> s : treeMap.entrySet()) {
	            String key = s.getKey();
	            String value = s.getValue();
	            if (ZStrUtil.hasNoText(value)) {
	                continue;
	            }
	            stringBuilder.append(key).append("=").append(value).append("&");
	        }
	        return ZStrUtil.substringBeforeLast(stringBuilder.toString(), "&");
		}
}
